package SingletonPattern;

/**
 * @Author: zhaojie
 * @Date: Created in 10:26 2018/6/26
 * @Description: 懒汉式，线程安全
 */
public class SingletonSynchronized {

    private static SingletonSynchronized singletonSynchronized;

    private SingletonSynchronized(){}

    public static  synchronized  SingletonSynchronized getSingletonSysnchronized(){
    if(singletonSynchronized==null){
        return new SingletonSynchronized();
    }
            return singletonSynchronized;
    }
}
